package cn.hahah.module.blog.dal.mysql.userreply;

import java.util.*;

import cn.hahah.framework.common.pojo.PageResult;
import cn.hahah.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hahah.framework.mybatis.core.mapper.BaseMapperX;
import cn.hahah.module.blog.dal.dataobject.userreply.UserReplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.hahah.module.blog.controller.admin.userreply.vo.*;

/**
 * 用户回复评论 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserReplyMapper extends BaseMapperX<UserReplyDO> {

    default PageResult<UserReplyDO> selectPage(UserReplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserReplyDO>()
                .eqIfPresent(UserReplyDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserReplyDO::getCommentId, reqVO.getCommentId())
                .eqIfPresent(UserReplyDO::getContent, reqVO.getContent())
                .betweenIfPresent(UserReplyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserReplyDO::getId));
    }

}